from enum import Enum


# 定义一个枚举类
class DBType(Enum):
    MYSQL = 'mysql'
    ORACLE = 'oracle'
    MONGODB = 'mongodb'


class TokenType(Enum):
    HROJ_TOKEN = 'hroj-token'
    RABBIT_PLATFORM_TOKEN = 'token'


# 测试代码
# class Gender(Enum):
#     Male = 0
#     Female = 1
#
#
# class Student(object):
#     def __init__(self, name, gender: Gender) -> None:
#         self.name = name
#         self.gender = Gender(gender) if isinstance(gender, Gender) else gender
#
#
# bart = Student('Bart', Gender.Male)
# print(bart.gender)
#
# # => 测试通过
# if bart.gender == Gender.Male:
#     print('测试通过')
# else:
#     print('测试失败')


if __name__ == '__main__':
    for k, v in TokenType.__members__.items():
        print(f'k={k},v={v.value}')
    print(TokenType.__members__.values().value)


